package org.tarasov.chapter2

/**
 * This source code free and open source
 * Author: Dmitriy Tarasov
 * Date: 04/04/11
 * Time: 22:56
 */

//java.util.List
def roman = ['', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII']
assert roman[4] == 'IV'
roman[8] = 'VIII'
assert roman.size() == 9
roman[10] = 'X'
println roman

//java.util.Map
def http = [
        100 : 'CONTINUE',
        200 : 'OK',
        400 : 'BAD REQUEST']
assert http[200] == 'OK'
http[500] = 'INTERNAL SERVER ERROR'
assert http.size() == 4
println http

//Ranges
def x = 1..10
assert x.contains(5)
assert !x.contains(15)
assert x.size() == 10
assert x.from == 1
assert x.to == 10
assert x.reverse() == 10..1